﻿@model RTW.OA.Models.calendar
@{
    Layout = "~/Views/Shared/_LayoutBase.cshtml";
}
@section styles{
}

<div id="dMain">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox" style="margin-bottom: 0px;">
            <div class="ibox-title">
                <h4>@ViewBag.Title </h4>
            </div>
            <div class="ibox-content">
                @using (Html.BeginForm("Edit", "Calendar", FormMethod.Post, new { area = "Personal", id = "calendarfrom", name = "calendarfrom" }))
                {
                    @Html.AntiForgeryToken()
                    @Html.HiddenFor(m => m.CAL_ID)
                <div class="from-content">
                    <dl>
                        <dt>开始时间</dt>
                        <dd>
                            @Html.EditorFor(m => m.CAL_TIME, new { htmlAttributes = new { @Class = "input rule-date-input form-control", onfocus = "WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss'})" } })
                        </dd>
                    </dl>
                    <dl>
                        <dt>结束时间</dt>
                        <dd>
                            @Html.EditorFor(m => m.END_TIME, new { htmlAttributes = new { @Class = "input rule-date-input form-control", onfocus = "WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss'})" } })
                        </dd>
                    </dl>
                    <dl>
                        <dt>事务类型</dt>
                        <dd>
                            <div class="rule-single-select">@Html.DropDownListFor(m => m.CAL_TYPE, ViewBag.CAL_TYPEData as List<SelectListItem>, new { @Class = "form-control" })</div>
                        </dd>
                    </dl>
                    <dl>
                        <dt>优先级</dt>
                        <dd>
                            <div class="rule-single-select">@Html.DropDownListFor(m => m.CAL_LEVEL, ViewBag.CAL_LEVELData as List<SelectListItem>, new { @Class = "form-control" })</div>
                        </dd>
                    </dl>
                    <dl>
                        <dt>事务内容</dt>
                        <dd>
                            @Html.TextAreaFor(m => m.CONTENT, new { @class = "editor" })
                        </dd>
                    </dl>
                    <dl>
                        <dt>安排人的用户</dt>
                        <dd>
                            @Html.EditorFor(m => m.MANAGER_ID, new { htmlAttributes = new { @class = "input normal form-control" } })
                        </dd>
                    </dl>
                    <dl>
                        <dt>完成状态</dt>
                        <dd>
                            <div class="rule-single-select">@Html.DropDownListFor(m => m.OVER_STATUS, ViewBag.OVER_STATUSData as List<SelectListItem>, new { @Class = "form-control" })</div>
                        </dd>
                    </dl>
                    <dl>
                        <dt>提前提醒时间</dt>
                        <dd>
                            @Html.EditorFor(m => m.BEFORE_REMAIND, new { htmlAttributes = new { @Class = "input rule-date-input form-control", onfocus = "WdatePicker({ dateFmt: 'yyyy-MM-dd HH:mm:ss'})" } })
                        </dd>
                    </dl>
                    <dl>
                        <dt>参与者</dt>
                        <dd>
                            @Html.EditorFor(m => m.TAKER, new { htmlAttributes = new { @class = "input normal form-control" } })
                        </dd>
                    </dl>
                    <dl>
                        <dt>全天</dt>
                        <dd>
                            <div class="rule-single-select">@Html.DropDownListFor(m => m.ALLDAY, ViewBag.ALLDAYData as List<SelectListItem>, new { @Class = "form-control" })</div>
                        </dd>
                    </dl>
                </div>
                    <div class="from-footer">
                        <div class="btn-wrap" style="position: fixed;">
                            @if (Model.CAL_ID>0)
                            {
                                <a class="btn btn-danger btn-primary radius" onclick="deletefrom(@Model.CAL_ID)">
                                    <i class="iconfont icon-dete"></i>
                                    删除数据
                                </a>
                            }
                            <a class="btn btn-sm btn-primary radius" onclick="savefrom()">
                                <i class="iconfont icon-save"></i>
                                提交保存
                            </a>
                            <a class="btn btn-sm btn-warning radius" onclick="closefrom()">
                                <i class="iconfont icon-fanhui"></i>
                                取消关闭
                            </a>
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
</div>
@section scripts{
    <script src="@Url.Content("~/Content/JS/common/WdatePicker/WdatePicker.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/JS/common/jquery/Validform_v5.3.2_min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/JS/common/artdialog/dialog-plus-min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/JS/common/webuploader/webuploader.min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/editor/ueditor.config.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/editor/ueditor.all.min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/editor/lang/zh-cn/zh-cn.js")"></script>
    @*<script type="text/javascript" charset="utf-8" src="../js/uploader.js"></script>*@

    <script src="@Url.Content("~/Content/JS/common/from.js")"></script>
    <script>
        $(function () {
            //初始化表单验证
            $("#calendarfrom").initValidform();
        });
        function savefrom() {
            $("#calendarfrom").submit();
        }
        function closefrom()
        {
            location.href = "/Personal/Calendar/Index";
        }
        function deletefrom(id) {
            layer.confirm('是否删除此日程？', {
                btn: ['确定', '取消'] //按钮
            }, function () {
                var url = '@Url.Action("Delete", "Calendar", new { area = "Personal" })\/'+id;
                $.get(url, function (result) {
                    layer.msg('删除日程成功！',
                        { icon: 1,time: 2000//2s后自动关闭
                        });
                    location.href = "/Personal/Calendar/Index";
                });
            });
        }
    </script>
}